/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlysinhvien;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javafx.beans.property.SimpleStringProperty;

/**
 *
 * @author SOUMA
 */
public class SinhVien {

    private final SimpleStringProperty idSV;
    private final SimpleStringProperty nameSV;
    private final SimpleStringProperty doB;
    private final SimpleStringProperty sex;
    private final SimpleStringProperty nameCon;
    private SimpleStringProperty comment;

    public SinhVien(String idSV, String nameSV, String doB, int sex, String nameCon, String comment) {
        this.idSV = new SimpleStringProperty(idSV);
        this.nameSV = new SimpleStringProperty(nameSV);
        this.doB = new SimpleStringProperty(doB);
        this.sex = new SimpleStringProperty(set_Sex(sex));
        this.nameCon = new SimpleStringProperty(nameCon);
        this.comment = new SimpleStringProperty(comment);
    }

    public String getIdSV() {
        return idSV.get();
    }

    public void setIdSV(String idSV) {
        this.idSV.set(idSV);
    }

    public String getNameSV() {
        return nameSV.get();
    }

    public void setNameSV(String nameSV) {
        this.nameSV.set(nameSV);
    }

    public String getDoB() {
        return doB.get();
    }

    public void setDoB(String doB) {
        this.doB.set(doB);
    }

    public String getSex() {
        return sex.get();
    }

    public void setSex(int sex) {
        this.sex.set(set_Sex(sex));
    }

    public String getNameCon() {
        return nameCon.get();
    }

    public void setNameCon(String nameCon) {
        this.nameCon.set(nameCon);
    }

    public String getComment() {
        return comment.get();
    }

    public void setComment(SimpleStringProperty comment) {
        this.comment = comment;
    }

    private String set_Sex(int sex) {
        return sex == 1 ? "Nam" : "Nữ";
    }

}
